home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
exitwi4r
/
module1.bas
< prev
next >
Wrap
BASIC Source File
|
1999-07-12
|
3KB
|
91 lines
Attribute VB_Name = "Module1"
Dim linex1 As Variant
Dim liney1 As Variant
Dim liney2 As Variant
Dim linex2 As Variant
Dim circlex As Variant
Dim circley As Variant
Dim circler As Variant
Dim colour As Long
Function getcommand(searchin As String) As String
Dim n As Integer, s As String
'Here it search on the text for a space then it gets its position on the text
n = InStr(1, searchin, " ", vbTextCompare)
'it gets the string from th start position (1) to the end position (n)
s = Mid(searchin, 1, n - 1)
'for reading any command on any state i format it to set all the letters on capital state
s = Format(s, ">")
'it return the string to the function
getcommand = s
End Function
Function getval(searchin As String) As String
Dim n As Integer, s As String
'Here it search on the text for a space then it gets its position on the text
n = InStr(1, searchin, " ", vbTextCompare)
'it gets the number of charchters on the text
x = Len(searchin)
'it gets the string from th start position (n) to the end of the text
s = Mid(searchin, n + 1, x - 1)
'it return the string to the function
getval = s
End Function
Sub docommand(cmnd As String, cval As String)
On Error Resume Next
'Her the programe find the command and excute it
'it select the value of cmnd and then excute it
Select Case cmnd
'Here it selcet the case (print) that = to cmnd value
Case "PRINT":
'Print the command value (cval) to form2
Form2.Print cval
Case "DEBUG.PRINT":
MDIForm1.Picture2.Print cval
Case "LINEX1":
linex1 = cval
Case "LINEY1":
liney1 = cval
Case "LINEX2":
linex2 = cval
Case "LINEY2":
liney2 = cval
Case "DOLINE":
Form2.Line (linex1, liney1)-(linex2, liney2)
Case "CLS":
Form2.Cls
Case "PRINTFORM":
Form2.PrintForm
Case "CIRCLEX":
circlex = cval
Case "CIRCLEY":
circley = cval
Case "CIRCLERADIUS":
circler = cval
Case "CIRCLECOLOR":
If cval = "RED" Then colour = vbRed
If cval = "GREEN" Then colour = vbGreen
If cval = "WHITE" Then colour = vbWhite
If cval = "BLACK" Then colour = vbBlack
If cval = "YELLOW" Then colour = vbYellow
colour = cval
Case "DOCIRCLE":
Form2.Circle (circlex, circley), circler, colour
Case "SCREEN.CAPTION":
Form2.Caption = cval
Case "SCREEN.PICTURE":
Form2.Picture = LoadPicture(cval)
Case "SCREEN.FORECOLOR":
If cval = "RED" Then colour = vbRed
If cval = "GREEN" Then colour = vbGreen
If cval = "WHITE" Then colour = vbWhite
If cval = "BLACK" Then colour = vbBlack
If cval = "YELLOW" Then colour = vbYellow
Form2.ForeColor = colour
Case "SCREEN.FONTNAME":
Form2.FontName = cval
Case "SCREEN.FONTSIZE":
Form2.FontSize = cval
End Select
End Sub